import ReactDOM from 'react-dom/client';
import { Provider } from 'react-redux';
import { App, ConfigProvider } from 'antd';
import zhCN from 'antd/es/locale/zh_CN';
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
dayjs.locale('zh-cn'); // 全局使用简体中文

import store from '@/store'; // redux的store
import Application from './App'; // 引入组件

import './index.css'; // 全局样式
import 'mac-scrollbar/dist/mac-scrollbar.css'; // mac-scrollbar样式

ReactDOM.createRoot(document.getElementById('root')).render(
    <Provider store={store}>
        <ConfigProvider
            locale={zhCN}
            theme={{
                cssVar: true,
                token: {
                    colorPrimary: '#FF4DAC',
                    colorBorder: '#B2B2B2',
                    screenXSMax: 640,
                    screenSMMin: 640,
                    screenSM: 640,
                    screenSMMax: 768,
                    screenMDMin: 768,
                    screenMD: 768,
                    screenMDMax: 1024,
                    screenLGMin: 1024,
                    screenLG: 1024,
                    screenLGMax: 1280,
                    screenXLMin: 1280,
                    screenXL: 1280,
                    screenXLMax: 1536,
                    screenXXLMin: 1536,
                    screenXXL: 1536,
                },
            }}
        >
            {/* antd App容器 */}
            <App>
                <Application />
            </App>
        </ConfigProvider>
    </Provider>
)
